package Function;
import java.io.IOException;
import java.util.Date;
import java.util.logging.FileHandler;
import java.util.logging.Formatter;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;  
public class ServerRunLog {
	InitAll init;
	static Logger log;
	private String logPath  ;
	public ServerRunLog(InitAll init) throws SecurityException, IOException{
		this.init = init;
		this.logPath = init.logPath;
		log = Logger.getLogger("tesglog");  
        log.setLevel(Level.ALL);  
        FileHandler fileHandler = new FileHandler(logPath);  
        fileHandler.setLevel(Level.ALL);  
        fileHandler.setFormatter(new LogFormatter());  
        log.addHandler(fileHandler);  
        //log.info("This is test java util log");     
        
	}
	

}
class LogFormatter extends Formatter {  
    @Override  
    public String format(LogRecord record) {  
        Date date = new Date();  
        String sDate = date.toString();  
        return "[" + sDate + "]" + "[" + record.getLevel() + "]"  
                + record.getClass() + record.getMessage() + "\n";  
    }  
  
}  